Subclasses have the Same Member (SSM)

Description:

SSM detects whether two or more direct subclasses of a class or interface declare fields with the same name and type or methods with the same name and signature. The audit's property, Percent of base classes where the same member is declared, specifies the minimum percentage of subclasses with the same member. By default, it equals 0, and SSM produces a message when the same member is declared by two or more subclasses. If the option is set to 100, then a message will be produced only when the same member is declared by all of the subclasses.

The SSM audit produces the message even if the same field is defined in several classes implementing the same interface. Although a field cannot be moved to the interface, the programmer can introduce an extra base class implementing this interface and move the field there.

Incorrect:

public class Employee {
    ...
}

public class Salesman : Employee {
    private string name;
    ...
}

public class Engineer : Employee {
    private string name;
    ...
}

Correct:

public class Employee {
    protected string name;
    ...
}

public class Salesman : Employee {
    ...
}

public class Engineer : Employee {
    ...
}

Refactoring: